package com.cyt.web.controller.sys;

import com.cyt.base.enums.BusinessType;
import com.cyt.base.enums.OperatorType;
import com.cyt.base.model.dto.ReturnResult;
import com.cyt.sys.aspect.BaseLog;
import com.cyt.sys.model.vo.SysGuideVo;
import com.cyt.sys.service.SysGuideService;
import com.cyt.web.controller.base.BaseController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * 操作指引-操作指引控制层
 *
 * @author rong yuan
 * @date 2019-8-20 13:52:09
 */
@RestController
public class SysGuideController extends BaseController {

    @Resource
    private SysGuideService sysGuideService;

    /**
     * 保存或更新
     *
     * @param request    请求对象
     * @param sysGuideVo 接受参数对象
     * @return ReturnResult
     * @author rong yuan
     * @date 2019-8-20 13:52:09
     */
    @BaseLog(module = "操作指引", classz = "操作指引", methods = "保存或更新对象", businessType = BusinessType.INSERT, operatorType = OperatorType.MANAGE)
    @RequestMapping(value = "/sys/sysguide/addOrUpdate", method = RequestMethod.POST)
    public ReturnResult addOrUpdate(HttpServletRequest request, SysGuideVo sysGuideVo) {
        return sysGuideService.addOrUpdate(sysGuideVo, acceptCurrentUser(request));
    }
}